package com.ax.associator.system.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ax.associator.store.common.ajax.AjaxRes;
import com.ax.associator.store.common.utils.Const;
import com.ax.associator.store.common.utils.PageUtils;
import com.ax.associator.system.service.LoginService;

@Controller
@ResponseBody
@RequestMapping("/sys")
public class LoginController {

	@Autowired
	LoginService loginService;
	
	/**
     * 登录(药师,医师)
     * 
     * @param passWord,userName
     * 
     * @return SUCC
     */
    @RequestMapping("/login")
    public AjaxRes queryPersonnel(AjaxRes ajaxRes,String passWord,String userName){
        try {
            loginService.queryUserLoginSer(userName,passWord);
            ajaxRes.setSucceed(Const.OPERATE_SUCCEED);
        }catch (Exception e){
            ajaxRes.setFailMsg(e.getMessage());
        }
        return ajaxRes;
    }
	
}
